package cn.pconline.officialclub.entity;

import cn.pconline.autoclub.util.ClubModule;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.Map;
import java.util.TreeMap;
import org.gelivable.dao.Column;
import org.gelivable.dao.Entity;
import org.gelivable.dao.Id;
import org.gelivable.dao.Mid;
import org.gelivable.dao.Transient;

/**
 * 官方车友会首页子模块
 *
 * @author <a href="mailto:chensy0203@163.com">chensy</a>
 */
@Entity(tableName = "oac_club_module")
public class OClubModule extends EntityKit {

    /**
     * 焦点图
     */
    public static final long MODULE_ID_FOCUS_IMG = 1;
    /**
     * 最新动态
     */
    public static final long MODULE_ID_DYNA = 2;
    /**
     * 最新活动
     */
    public static final long MODULE_ID_ACTIVITY = 3;
    /**
     * 最新相片
     */
    public static final long MODULE_ID_PHOTO = 4;
    /**
     * 最新访客
     */
    public static final long MODULE_ID_VISITOR = 5;
    /**
     * 公告
     */
    public static final long MODULE_ID_NOTICE = 6;
    /**
     * 入驻车友会列表
     */
    public static final long MODULE_ID_CLUB = 7;
    public static final Map<Long, ClubModule> defMoudleMap = new TreeMap<Long, ClubModule>();

    static {
        defMoudleMap.put(MODULE_ID_FOCUS_IMG, new ClubModule(MODULE_ID_FOCUS_IMG, "", "焦点图", OClubModule.STATUS_NORMAL));
        defMoudleMap.put(MODULE_ID_DYNA, new ClubModule(MODULE_ID_DYNA, "", "最新动态", OClubModule.STATUS_NORMAL));
        defMoudleMap.put(MODULE_ID_ACTIVITY, new ClubModule(MODULE_ID_ACTIVITY, "", "最新活动", OClubModule.STATUS_NORMAL));
        defMoudleMap.put(MODULE_ID_PHOTO, new ClubModule(MODULE_ID_PHOTO, "", "最新相片", OClubModule.STATUS_NORMAL));
        defMoudleMap.put(MODULE_ID_VISITOR, new ClubModule(MODULE_ID_VISITOR, "", "最新访客", OClubModule.STATUS_NORMAL));
        defMoudleMap.put(MODULE_ID_NOTICE, new ClubModule(MODULE_ID_NOTICE, "", "公告", OClubModule.STATUS_NORMAL));
        defMoudleMap.put(MODULE_ID_CLUB, new ClubModule(MODULE_ID_CLUB, "", "入驻车友会", OClubModule.STATUS_NORMAL));
    }
    /**
     * 隐藏状态 *
     */
    public static final int STATUS_HIDDEN = -1;
    /**
     * 正常状态 *
     */
    public static final int STATUS_NORMAL = 0;
    /**
     * 官方车友会ID
     */
    @Id
    @Column(name = "o_club_id")
    private long oClubId;
    /**
     * 官方车友会模块ID
     */
    @Id
    @Column(name = "module_id")
    private long moduleId; //车友会模块ID
    /**
     * 状态,0:显示,-1:隐藏
     */
    @Column(name = "status")
    private int status;
    /**
     * 模块顺序
     */
    @Column(name = "seq")
    private int seq;
    @Transient
    @JSONField(serialize = false, deserialize = false)
    private ClubModule clubModule;

    /**
     * 兼容geli
     *
     * @return
     */
    public long getOClubId() {
        return oClubId;
    }

    /**
     * 兼容geli
     *
     * @return
     */
    public void setOClubId(long oClubId) {
        this.oClubId = oClubId;
    }

    public long getoClubId() {
        return oClubId;
    }

    public void setoClubId(long oClubId) {
        this.oClubId = oClubId;
    }

    public long getModuleId() {
        return moduleId;
    }

    public int getStatus() {
        return status;
    }

    public int getSeq() {
        return seq;
    }

    public ClubModule getClubModule() {
        return clubModule;
    }


    public void setModuleId(long moduleId) {
        this.moduleId = moduleId;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public void setClubModule(ClubModule clubModule) {
        this.clubModule = clubModule;
    }

    public Mid getId() {
        return new Mid(oClubId, moduleId);
    }
}
